<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="crm.util.ParamUtil"%>
<%@page import="crm.model.Schedule"%>
<%@page import="crm.control.ScheduleControl"%>
<%@page import="crm.util.DateTime"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>schedule_finish</title>
</head>
<body>
<%
request.setCharacterEncoding("UTF-8");
int schedule_id = ParamUtil.getInt(request,"id");
Schedule schedule = new Schedule();
schedule=ScheduleControl.getSecheduleInfomation(schedule_id);
schedule.setState("已完成");
schedule.setFinish_time(DateTime.DateTime());
if(ScheduleControl.finishSchedule(schedule,schedule_id)){
 %>
   	 <script type="text/javascript">
  	 	alert("完成日程成功！");
  	 	location.href="schedule.jsp"
  	 </script>
  	 <%}else{%>
  	 	<script type="text/javascript">
  	 		alert("完成日程失败！");
  	 		location.href="schedule.jsp"
  	 	</script>
 <%} %>
</body>
</html>